<div class="u_cat">
	<div class="u_cat_head_strip"></div>
	<div class="u_cat_head">
		<a href="<?php echo Yii::app()->createUrl('albums/indexEvent', array('event'=>$model->id));?>">
			<em>Фотоальбомы</em><span><?php echo CHtml::encode($model->countAlbums); ?></span>
		</a>
	</div>
	<?php if($model->countAlbums) : ?>
		<div class="u_cat_media albums">
			<?php foreach ($model->albums as $key => $album){ ?>
				<?php $class = (!$key) ? 'u_media' : 'u_media hidden'; ?>
				<a href="<?php echo Yii::app()->createUrl('albums/viewEvent',array('id' => $album->id, 'event'=>$model->id));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>">
					<?php echo  ($album->main_photo!=NULL) ? 
							$this->material_image($album->id, $album->main_photo->name, '180', 'events/'.$model->id.'/'.$album->id): 
								$this->material_image(0, 'noimage.gif', '180', ''); ?>
				</a>
			<?php } ?>	
			<div class="u_media_nav">
				<div class="u_media_nav_prev"></div>
				<div class="u_media_nav_next"></div>
				<?php foreach ($model->albums as $key => $album){ ?>
					<?php $class = (!$key) ? 'u_media_nav_name' : 'u_media_nav_name hidden'; ?>
					<a href="<?php echo Yii::app()->createUrl('albums/viewEvent',array('id' => $album->id, 'event'=>$model->id));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>_"><?php echo CHtml::encode($album->name); ?></a>
				<?php } ?>
			</div>
		</div>
	<?php else : ?>
	<div class="u_cont_list">
		<div class="u_cont">
			<div class="u_cont_r_empty ajaxLinks">
				В сообществе ещё нет мероприятий.
				<?php if(isset( $model->group->checkAdmin )) : ?>
					<p><a href="<?php echo Yii::app()->createUrl('albums/createEvent', array('event'=>Yii::app()->request->getParam('event')));?>" class="u_cont_h2_discussion ajaxLink">
						Добавить 
					</a></p>
				<?php endif ?>
			</div>
		</div>
	</div>
	<?php endif; ?>
</div>
